Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

soft delete logic fixing tests for BigQuery #857

Merged
merged 9 commits into from
Dec 26, 2023
Merged

Conversation

heavycrystal
Copy link
Contributor

No description provided.

serprex
serprex previously approved these changes Dec 20, 2023
@serprex serprex self-requested a review December 21, 2023 23:45
@serprex
Copy link
Contributor

serprex commented Dec 21, 2023

  1. Update PR title that this isn't a draft anymore
  2. Seems like tests are slower in this PR, can these test cases be made faster or be split up?

@serprex serprex dismissed their stale review December 22, 2023 00:02

tests slow

@heavycrystal heavycrystal changed the title Draft: soft delete tests for BigQuery soft delete logic fixing tests for BigQuery Dec 22, 2023
@heavycrystal
Copy link
Contributor Author

heavycrystal commented Dec 22, 2023

I think the BQ tests are becoming slower due to metadata table advisory lock contention. This is needed because BQ doesn't allow concurrent updates.

Changed the lock acquisition logic slightly.

@@ -452,7 +452,8 @@ func (c *BigQueryConnector) getTableNametoUnchangedCols(flowJobName string, sync
// Prepare the query to retrieve distinct tables in that batch
query := fmt.Sprintf(`SELECT _peerdb_destination_table_name,
array_agg(DISTINCT _peerdb_unchanged_toast_columns) as unchanged_toast_columns FROM %s.%s
WHERE _peerdb_batch_id > %d and _peerdb_batch_id <= %d GROUP BY _peerdb_destination_table_name`,
WHERE _peerdb_batch_id > %d AND _peerdb_batch_id <= %d AND _peerdb_record_type != 2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Include in PR description what _peerdb_record_type != 2 achieves

@iskakaushik iskakaushik enabled auto-merge (squash) December 26, 2023 18:31
@iskakaushik iskakaushik merged commit 67ab274 into main Dec 26, 2023
@serprex serprex deleted the soft-delete-tests-bq branch February 5, 2024 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants